package model.game.maze;

import java.util.ArrayList;
import model.algorithms.IAction;
import model.algorithms.a_star.AStar;

public class MazeRun {
	private static int[][] mazeMatrix = {
		{ 0, -1,  0, -1, 0 },
		{ 0,  0,  2, -1, 0 },
		{ 0, -1, -1, -1, 1 },
		{ 0, -1, -1,  0, 0 },
		{ 0,  0,  0,  0, 0 }
};

//	private static int[][] mazeMatrix = {
//		{  2, -1, -1 },
//		{  0, -1,  1 },
//		{ -1,  0, -1 }
//	};
	
	public static void main(String[] args) {
		Maze maze = new Maze(mazeMatrix);
		
		AStar as = new AStar(new MazeDomain(maze), new MazeG(), new MazeH());
		
		ArrayList<IAction> actions = as.search(maze.getStartState(), maze.getGoalState());
		
		if (actions.size() == 0) {
			System.out.println("No path found.");
		}
		else {
			for (IAction a : actions) {
				System.out.println(a.getName());
			}
		}
	}
}
